﻿namespace Ops.Host.App.ViewModels;

public sealed class SpotCheckViewModel : AsyncSinglePagedViewModelBase<DvSpotCheck, SpotCheckFilter>, IViewModel
{
    private readonly IDvSpotCheckService _spotCheckService;

    public SpotCheckViewModel(IDvSpotCheckService spotCheckService)
    {
        _spotCheckService = spotCheckService;
    }

    protected override void OnExcelModelCreating(ExcelModelBuilder builder)
    {
        builder.ExcelName = "点检信息";
        builder.HasExcelNameDatePostfix = true;
    }

    protected override async Task<PagedList<DvSpotCheck>> OnSearchAsync(int pageIndex, int pageSize)
    {
        return await _spotCheckService.GetPagedListAsync(QueryFilter, pageIndex, pageSize);
    }
}
